<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" th:href="@{/static/bootstrap/css/bootstrap.min.css}" >
</head>
<body>

<nav class="navbar navbar-default">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/">java知识论坛</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">

            <form action="/?page=0" class="navbar-form navbar-left">
                <div class="form-group">
                    <input type="text" name="search" class="form-control" placeholder="搜索问题">
                </div>
                <button type="submit" class="btn btn-default">搜索</button>
            </form>
            <ul class="nav navbar-nav navbar-left">
                <li><a href="#">ssm</a></li>
                <li><a href="#">Link</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right" >
                <li th:if="${session.USER} ne null">
                    <a class="glyphicon glyphicon-bell" href="/people/notifiction">通知<span class="badge" th:text="${session.UNREADNOTIFIER}"></span></a>
                </li>
                <li th:if="${session.USER} eq null">
                    <a href="/login">登录</a>
                </li>
                <li th:if="${session.USER} ne null">
                    <a href="/publish">发布问题</a>
                </li>
                <li role="presentation" class="dropdown" th:if="${session.USER} ne null">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true" >
                        <span th:text="${session.USER.nickName}"></span> <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu">
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="/people">我的主页</a>
                        </li>
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="/logout">退出登录</a>
                        </li>
                    </ul>
                </li>

            </ul>

        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>



<script th:src="@{/static/bootstrap/js/jquery.js}" ></script>
<script src="/static/bootstrap/js/bootstrap.min.js" ></script>
<script>
    $('.dropdown-toggle').dropdown();
</script>
</body>
</html>
